package org.fuys.coder.infrastructure.model.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 抽奖策略表
 * @TableName lottery_strategy
 */
@TableName(value ="lottery_strategy")
@Data
public class LotteryStrategy implements Serializable {
    /**
     * 主键 自增
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 抽奖策略描述
     */
    private String strategyDesc;

    /**
     * 抽奖策略模式 均匀分布或者是设置不同阶层
     */
    private Integer strategyMode;

    /**
     * 补充信息
     */
    private String extInfo;

    /**
     * 此策略适合的数量
     */
    private Integer suitNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        LotteryStrategy other = (LotteryStrategy) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStrategyDesc() == null ? other.getStrategyDesc() == null : this.getStrategyDesc().equals(other.getStrategyDesc()))
            && (this.getStrategyMode() == null ? other.getStrategyMode() == null : this.getStrategyMode().equals(other.getStrategyMode()))
            && (this.getExtInfo() == null ? other.getExtInfo() == null : this.getExtInfo().equals(other.getExtInfo()))
            && (this.getSuitNum() == null ? other.getSuitNum() == null : this.getSuitNum().equals(other.getSuitNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStrategyDesc() == null) ? 0 : getStrategyDesc().hashCode());
        result = prime * result + ((getStrategyMode() == null) ? 0 : getStrategyMode().hashCode());
        result = prime * result + ((getExtInfo() == null) ? 0 : getExtInfo().hashCode());
        result = prime * result + ((getSuitNum() == null) ? 0 : getSuitNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", strategyDesc=").append(strategyDesc);
        sb.append(", strategyMode=").append(strategyMode);
        sb.append(", extInfo=").append(extInfo);
        sb.append(", suitNum=").append(suitNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}